xend: Do not overwrite xauthority and display with empty values
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 23 Apr 2009 09:09:16 +0000 (10:09 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 23 Apr 2009 09:09:16 +0000 (10:09 +0100)
Display and xauthority vars are read from vmConfig['platform'] first,
then they are read again from dev_info.
However if the user does not set those variable in the config file,
dev_info won't contain them, hence we are going to overwrite the
current significant values with null.
This patch fixes the problem setting display and xauthority to the
current values if dev_info does not contain them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
tools/python/xen/xend/image.py

index 9e978b97aa00bc492f72fb2d815e66b21750ad29..411936d5d69136b7ab7bdb532a606467f84678a9 100644 (file)
@@ -291,8 +291,8 @@ class ImageHandler:
                 if int(dev_info.get('sdl', 0)) != 0 :
                     has_sdl = True
                 if has_sdl:
-                    self.display = dev_info.get('display', {})
-                    self.xauthority = dev_info.get('xauthority', {})
+                    self.display = dev_info.get('display', self.display)
+                    self.xauthority = dev_info.get('xauthority', self.xauthority)
                     opengl = int(dev_info.get('opengl', opengl))
                 if has_vnc:
                     vnc_config = dev_info.get('other_config', {})